package com.dd.cloud.auth.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dd.cloud.auth.entity.AdminRole;
import org.apache.ibatis.annotations.Param;

/**
 * @author zk
 */
public interface AdminRoleMapper extends BaseMapper<AdminRole> {
    /**
     * 查询管理员角色是否为超管
     *
     * @param userId
     * @param flag
     * @return
     */
    Integer getRoleIsAdmin(@Param("userId") Integer userId, @Param("flag") Integer flag);

    /**
     * @description 查询超管的角色id
     * @param type:
     * @return Integer
     * @author czg
     * @date 2023/4/26 20:01
    */
    Integer getAdminRoleId(@Param("type") Integer type);

    /**
     * 用过用户id查询用户权限信息
     */
    AdminRole getAdminRoleByUser(@Param("id") Integer id, @Param("type") Integer type);
}
